﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="listPage.aspx.cs" Inherits="ZX.WebApp.DeskTop.listPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
     <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/reset-fonts-grids/reset-fonts-grids.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/container/assets/skins/sam/container.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/menu/assets/skins/sam/menu.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/button/assets/skins/sam/button.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/resize/assets/skins/sam/resize.css" />
    <link rel="stylesheet" type="text/css" href="../Scripts/yui_2.9.0/build/datatable/assets/skins/sam/datatable.css" />
    <link href="../Styles/base.css" rel="stylesheet" type="text/css" />
    <!--begin custom header content for this example-->
    <style type="text/css">
    .yui-skin-sam table {
	  width: 100%; 
    }
    
    #button-example-form fieldset, 
    #button-example-form fieldset div {
        border: 2px groove #ccc;
        margin: .5em;
        padding: .5em;
    }
    <% =DataTableCss %>
</style>
    <!--end custom header content for this example-->
    <!-- Dependencies -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/element/element-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/datasource/datasource-min.js"></script>
    <!-- OPTIONAL: JSON Utility (for DataSource) -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/json/json-min.js"></script>
    <!-- OPTIONAL: Connection Manager (enables XHR for DataSource) -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <!-- OPTIONAL: Get Utility (enables dynamic script nodes for DataSource) -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/get/get-min.js"></script>
    <!-- OPTIONAL: Drag Drop (enables resizeable or reorderable columns) -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/dragdrop/dragdrop-min.js"></script>
    <!-- OPTIONAL: Calendar (enables calendar editors) -->
    <%--<script type="text/javascript" src="../Scripts/yui_2.9.0/build/calendar/calendar-min.js"></script>--%>
    <!-- Source files -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/datatable/datatable-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/paginator/paginator-min.js"></script>

    <script type="text/javascript" src="../scripts/yui_2.9.0/build/layout/layout-min.js"></script>
    <script type="text/javascript" src="../scripts/yui_2.9.0/build/button/button-min.js"></script>
    <script type="text/javascript" src="../scripts/yui_2.9.0/build/container/container-min.js"></script>
    <script type="text/javascript" src="../scripts/yui_2.9.0/build/resize/resize-min.js"></script>
    <script type="text/javascript" src="../scripts/yui_2.9.0/build/event-delegate/event-delegate-min.js"></script>
    <script src="../Scripts/yui_3.0/build/yui/yui-min.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        var iSun = {
            version: "1.0.0",
            price: 5
        };
        var SysCache;
        YUI().use('cache', function (Y) {
            SysCache = new Y.Cache({ max: 20 });
            //myCache.add("Key1", iSun);
   
            //alert(myCache.retrieve("Key1").response.version);
            //myCache.flush();
        });
    </script>
</head>
<body class="yui-skin-sam">
    <form id="form1" runat="server">
        <div id="data">
            <div id="json">
            </div>
        </div>
    </form>
</body>
<!-- 通用方法 -->
<script src="../Scripts/common.js" type="text/javascript"></script>
<!-- 定义数据格式化方法 -->
<script src="../Scripts/yui.list.dataformat.js" type="text/javascript"></script>
<!--  用于加载自定义脚本 -->
<script src="../Scripts/appjs/model.<% =EntityName %>.js" type="text/javascript" language="javascript"></script> 
<script type="text/javascript">
    var const_entityID = "<% =EntityId %>",    //实体ID名称
        const_entityName = "<% =EntityName %>",//实体名称
        const_EditEntity = "<% =EditEntity %>",//编辑实体名
        const_functionId   ="<% =FunctionID %>",//自定义条件
        const_Order ="<% =Order %>",           //排序  
        const_UserId = "<% = UserId %>",       //
        const_DataFields = [<% =DataFields %>],
        const_DataColums = [<% =DataColums %>],

        const_EditWindowWidth = "<% =EditWindowWidth %>px",
		const_EditWindowHeight = "<% =EditWindowHeight %>px",

        const_QueryField="<% =QuciklyQueryFields %>",
        const_CustomCondition = encodeURI("<% =DefineCondition %>"),//查询方案条件
        const_Condition =  encodeURI("<% =Condition %>"),//
        const_PageTitle=encodeURI("<% =PageTitle %>"),
        selectControl=null,
        requireUrl="",
        initialRequestUrl = "pageindex=1&entity=" + const_entityName + "&order="+const_Order+"&r="+Math.random()+"&zip=94089&results=10&output=json&functionid="+const_functionId+"&customCondition="+ const_CustomCondition+"&condition="+const_Condition,
        SaveUrl,dl;//要删除的数据列  

</script> 

<!-- YUI  通用功能  -->
<script src="../Scripts/yui.list.common.js" type="text/javascript"></script>  
<!--  用于加载按扭方法 -->
<script src="../Scripts/yui.list.button.event.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
    //    var SetCache = function (i) {
    //        var requestStr = "AjaxData/JsonList.aspx?pagesize=" + pagesize + "&pageindex="+i+"&entity=" + const_entityName + "&order=" + const_Order + "&r=" + Math.random() + "&zip=94089&results=10&output=json&functionid=" + const_functionId + "&customCondition=" + const_CustomCondition;
    //        YAHOO.util.Connect.asyncRequest('POST', requestStr, {
    //            success: function (res) {
    //                //alert(res.responseText);
    //                var o = eval("(" + res.responseText + ")").rows;
    //                //alert(document.getElementById("pagetotal"));

    //                SysCache.add("Data"+i, o);
    //            },
    //            failure: function (error) {
    //                alert("数据错误：" + error.statusText);
    //            }
    //        }, null);
    //    }
    //    var InitCache = function () {
    //        for (var i = 1; i < 21; i++) {
    //            SetCache(i);
    //        }
    //    }
    //setTimeout(InitCache,3000);
    var SetCache = function () {
        //        var requestStr = "AjaxData/JsonList.aspx?setcache=true&pagesize=" + pagesize + "&pageindex=" + 1 + "&entity=" + const_entityName + "&order=" + const_Order + "&r=" + Math.random() + "&zip=94089&results=10&output=json&functionid=" + const_functionId + "&customCondition=" + const_CustomCondition;
        //        YAHOO.util.Connect.asyncRequest('POST', requestStr, {
        //            success: function (res) {
        //            },
        //            failure: function (error) {
        //                //alert("数据错误：" + error.statusText);
        //            }
        //        }, null);
    }
    //
    var RefreshCache = function () {
        //        var requestStr = "AjaxData/JsonList.aspx?IsRefreshCache=true&setcache=true&pagesize=" + pagesize + "&pageindex=" + 1 + "&entity=" + const_entityName + "&order=" + const_Order + "&r=" + Math.random() + "&zip=94089&results=10&output=json&functionid=" + const_functionId + "&customCondition=" + const_CustomCondition;
        //        YAHOO.util.Connect.asyncRequest('POST', requestStr, {
        //            success: function (res) {
        //            },
        //            failure: function (error) {
        //                //alert("数据错误：" + error.statusText);
        //            }
        //        }, null);
    }
    setTimeout(SetCache, 500);
</script>
</html>
